<?php
	require_once("conexion/conexion.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Formulario PSMB</title>
<link href="Estilos/global.css" rel="stylesheet" type="text/css" />
<link href="Estilos/local.css" rel="stylesheet" type="text/css" />
<link href="Estilos/CssTabla3.css" rel="stylesheet" type="text/css" />
<link href="Estilos/jquery.autocomplete.css" rel="stylesheet" type="text/css" />

<script src="include_js/jquery.js" type="text/javascript"></script>
<script src="include_js/jquery.autocomplete.js" type="text/javascript"></script>

<script>
function Llenar(json)
{
	$("#cliente").focus().autocomplete(json);
	
}

$(document).ready(function() 
{
	$.ajax({
			type: 'post',
			dataType: 'json',
			url: "CompletaClientePSMB.php",
			data: {valor: '1'},
			success: function(json){
				//alert(json[0]);
				Llenar(json);
				
			}
		});
});

</script>

</head>

<!--<body onload="foco();">-->
<body>
<form name="form_PSMB" id="form_PSMB" method="post">
<table width="100%" border="0" cellpadding="0">
  <tr>
    <td><div class='option2'><label style="font:Verdana, Arial, Helvetica, sans-serif; color:#0066CC; font-weight:bold;">Empresa Participante del PSMB (Responsable del monitoreo).</label></div>
	<div class='groupbox'>
      Cliente:&nbsp;&nbsp;
      <input id="cliente" name="cliente" type="text" align="absbottom" size="60" />&nbsp;&nbsp;&nbsp;
      <input name="btn_Buscar_Cli" id="btn_Buscar_Cli" type="button" value=" " class="buscar"/>
	  <input name="rut" id="rut" type="hidden" />
      </div></td>
  </tr>
</table>
</form>
<table width="100%" border="0" cellpadding="2" cellspacing="0">
  <tr>
    <td><div id="listado"></div></td>
  </tr>
</table>
</body>
<script>
$('#btn_Buscar_Cli').click(function() 
{ 
        $.ajax({
            type: 'POST',
            url: 'Produccion/lista_cliente.php',
            data: $('#form_PSMB').serialize(),
            success: function(data) {
                $('#listado').html(data);
            }
        })
});
/*$('#cliente').blur(function() 
{ 
       alert($('#cliente').val());
});*/
</script>
</html>